# -*- coding: utf-8 -*-
# Date: 2025-01-02
# Author: HonestQiao
#
# Desc: WiFi联网处理

import network
import time

# 联网处理
def do_connect(ssid, passwd):
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    wlan.connect(ssid, passwd)
    while not wlan.isconnected():
        print("try connect...")
        time.sleep(1)

    # 联网成功
    print("connect ok")